using System;
using System.Text;
using System.Collections.Generic;
using iBeauty.BusinessObjects;
using iBeauty.DAL;

namespace iBeauty.BLL
{
	public class ServiceGroupBLL
	{
		private ServiceGroupDAO _ServiceGroupDAO;

		public ServiceGroupDAO ServiceGroupDAO
		{
			get { return _ServiceGroupDAO; }
			set { _ServiceGroupDAO = value; }
		}

		public ServiceGroupBLL()
		{
			ServiceGroupDAO = new ServiceGroupDAO();
		}
		public List<ServiceGroup> GetServiceGroups()
		{
			try
			{
				return ServiceGroupDAO.GetServiceGroups();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public ServiceGroup GetServiceGroup(string ID)
		{
			try
			{
				return ServiceGroupDAO.GetServiceGroup(ID);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddServiceGroup(ServiceGroup oServiceGroup)
		{
			try
			{
				return ServiceGroupDAO.AddServiceGroup(oServiceGroup);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddServiceGroup(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string ServiceCode,string ServiceName,int? AccountId,string Note)
		{
			try
			{
				return ServiceGroupDAO.AddServiceGroup(ID,CreateDate,ModifiedDate,TimeStamp,ServiceCode,ServiceName,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateServiceGroup(ServiceGroup oServiceGroup)
		{
			try
			{
				return ServiceGroupDAO.UpdateServiceGroup(oServiceGroup);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateServiceGroup(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string ServiceCode,string ServiceName,int? AccountId,string Note)
		{
			try
			{
				return ServiceGroupDAO.UpdateServiceGroup(ID,CreateDate,ModifiedDate,TimeStamp,ServiceCode,ServiceName,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveServiceGroup(ServiceGroup oServiceGroup)
		{
			try
			{
				return ServiceGroupDAO.RemoveServiceGroup(oServiceGroup);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveServiceGroup(string ID)
		{
			try
			{
				return ServiceGroupDAO.RemoveServiceGroup(ID);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<ServiceGroup> DeserializeServiceGroups(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<ServiceGroup>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeServiceGroups(string Path, List<ServiceGroup> ServiceGroups)
		{
			try
			{
				GenericXmlSerializer<List<ServiceGroup>>.Serialize(ServiceGroups, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
